<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- QCtmHeaderView.cpp -->
  <meta name="description" content="自定义表头，提供了 checkbox 勾选功能.">
  <title>QCtmHeaderView Class | QCustomUi 1.16.0</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li><a href="index.html" translate="no">QCustomUi 1.16.0</a></li>
<li><a href="qcustomui-module.html" translate="no">QCustomUi</a></li>
<li>QCtmHeaderView</li>
<li id="buildversion">QCustomUi 1.16.0 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title" translate="no">QCtmHeaderView Class</h1>
<!-- $$$QCtmHeaderView-brief -->
<p>自定义表头，提供了 checkbox 勾选功能. <a href="#details">More...</a></p>
<!-- @@@QCtmHeaderView -->
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">  <span class="preprocessor">#include &lt;QCtmHeaderView.h&gt;</span></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="https://doc.qt.io/qt/qheaderview.html" translate="no">QHeaderView</a></td></tr>
</table></div>
<ul>
<li><a href="qctmheaderview-members.html">List of all members, including inherited members</a></li>
</ul>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#QCtmHeaderView" translate="no">QCtmHeaderView</a></b>(Qt::Orientation <i>orientation</i>, QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#dtor.QCtmHeaderView" translate="no">~QCtmHeaderView</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#setReadOnly" translate="no">setReadOnly</a></b>(int <i>logicIndex</i>, bool <i>enable</i>)</td></tr>
</table></div>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#setModel" translate="no">setModel</a></b>(QAbstractItemModel *<i>model</i>) override</td></tr>
</table></div>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#doCheckBoxRect" translate="no">doCheckBoxRect</a></b>(int <i>logicalIndex</i>) const</td></tr>
</table></div>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#mousePressEvent" translate="no">mousePressEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#paintSection" translate="no">paintSection</a></b>(QPainter *<i>painter</i>, const QRect &amp;<i>rect</i>, int <i>logicalIndex</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qctmheaderview.html#sectionSizeFromContents" translate="no">sectionSizeFromContents</a></b>(int <i>logicalIndex</i>) const override</td></tr>
</table></div>
<!-- $$$QCtmHeaderView-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@QCtmHeaderView -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCtmHeaderView[overload1]$$$QCtmHeaderViewQt::OrientationQWidget* -->
<h3 class="fn" translate="no" id="QCtmHeaderView"><code class="details extra" translate="no">[explicit]</code> QCtmHeaderView::<span class="name">QCtmHeaderView</span>(<span class="type"><a href="https://doc.qt.io/qt/qt.html#Orientation-enum" translate="no">Qt::Orientation</a></span> <i>orientation</i>, <span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>构造函数 <i translate="no">orientation</i>, <i translate="no">parent</i>.</p>
<!-- @@@QCtmHeaderView -->
<!-- $$$~QCtmHeaderView[overload1]$$$~QCtmHeaderView -->
<h3 class="fn" translate="no" id="dtor.QCtmHeaderView"><code class="details extra" translate="no">[virtual noexcept]</code> QCtmHeaderView::<span class="name">~QCtmHeaderView</span>()</h3>
<p>析构函数.</p>
<!-- @@@~QCtmHeaderView -->
<!-- $$$doCheckBoxRect[overload1]$$$doCheckBoxRectint -->
<h3 class="fn" translate="no" id="doCheckBoxRect"><code class="details extra" translate="no">[protected]</code> <span class="type"><a href="https://doc.qt.io/qt/qrect.html" translate="no">QRect</a></span> QCtmHeaderView::<span class="name">doCheckBoxRect</span>(<span class="type">int</span> <i>logicalIndex</i>) const</h3>
<p>计算 checkbox 的包围盒 <i translate="no">logicalIndex</i>.</p>
<!-- @@@doCheckBoxRect -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn" translate="no" id="mousePressEvent"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">void</span> QCtmHeaderView::<span class="name">mousePressEvent</span>(<span class="type"><a href="https://doc.qt.io/qt/qmouseevent.html" translate="no">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qheaderview.html#mousePressEvent" translate="no">QHeaderView::mousePressEvent</a>(QMouseEvent *e).</p>
<!-- @@@mousePressEvent -->
<!-- $$$paintSection[overload1]$$$paintSectionQPainter*constQRect&int -->
<h3 class="fn" translate="no" id="paintSection"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">void</span> QCtmHeaderView::<span class="name">paintSection</span>(<span class="type"><a href="https://doc.qt.io/qt/qpainter.html" translate="no">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="https://doc.qt.io/qt/qrect.html" translate="no">QRect</a></span> &amp;<i>rect</i>, <span class="type">int</span> <i>logicalIndex</i>) const</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qheaderview.html#paintSection" translate="no">QHeaderView::paintSection(QPainter *painter, const QRect &amp;rect, int logicalIndex) const</a>.</p>
<!-- @@@paintSection -->
<!-- $$$sectionSizeFromContents[overload1]$$$sectionSizeFromContentsint -->
<h3 class="fn" translate="no" id="sectionSizeFromContents"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type"><a href="https://doc.qt.io/qt/qsize.html" translate="no">QSize</a></span> QCtmHeaderView::<span class="name">sectionSizeFromContents</span>(<span class="type">int</span> <i>logicalIndex</i>) const</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qheaderview.html#sectionSizeFromContents" translate="no">QHeaderView::sectionSizeFromContents(int logicalIndex) const</a>.</p>
<!-- @@@sectionSizeFromContents -->
<!-- $$$setModel[overload1]$$$setModelQAbstractItemModel* -->
<h3 class="fn" translate="no" id="setModel"><code class="details extra" translate="no">[override virtual]</code> <span class="type">void</span> QCtmHeaderView::<span class="name">setModel</span>(<span class="type"><a href="https://doc.qt.io/qt/qabstractitemmodel.html" translate="no">QAbstractItemModel</a></span> *<i>model</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qheaderview.html#setModel" translate="no">QHeaderView::setModel</a>(QAbstractItemModel *model).</p>
<!-- @@@setModel -->
<!-- $$$setReadOnly[overload1]$$$setReadOnlyintbool -->
<h3 class="fn" translate="no" id="setReadOnly"><span class="type">void</span> QCtmHeaderView::<span class="name">setReadOnly</span>(<span class="type">int</span> <i>logicIndex</i>, <span class="type">bool</span> <i>enable</i>)</h3>
<p>设置 <i translate="no">logicIndex</i> 行/列只读 <i translate="no">enable</i>.</p>
<!-- @@@setReadOnly -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> QCustomUi
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/> </div>
</body>
</html>
